MySQL introduction by Antun Peicevic

MySQL introduction by Antun Peicevic

Author:Antun Peicevic [Peicevic, Antun]
Language: eng
Format: epub, pdf
Publisher: Geek University Press
Published: 2016-03-09T23:00:00+00:00


Advanced SELECT statements

We can use many different clauses to change the behaviour of the SELECT statement. In this chapter we will describe and give examples of some common ones.

Display the number of rows in the table

We can use the COUNT() function to return the number of rows that matches a specified criteria. For example, to display the number of all rows in a table, we can use the following command:

mysql> SELECT * FROM testtb;

+------+-------------+------+

| name | surname | year |

+------+-------------+------+

| Amy | Goodridge | 1991 |

| Mark | Smith | 1955 |

| John | von Neumann | 1921 |

| John | Jones | 1985 |

+------+-------------+------+

4 rows in set (0.00 sec)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.